import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class TestLoadingWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("各式各样的loading"),
      ),
      body: SingleChildScrollView(
        child: Column(
          children: <Widget>[
            CircularProgressIndicator(),
            CupertinoActivityIndicator(
              radius: 10,
            ),
            RefreshProgressIndicator(
//              backgroundColor: Colors.greenAccent,
//              valueColor: AlwaysStoppedAnimation<Color>(Colors.red),
//              strokeWidth: 2.0,
            ),
            //Flex的两个子widget按1：2来占据水平空间
            Flex(
              direction: Axis.horizontal,
              children: <Widget>[
                Expanded(
                  flex: 1,
                  child: Container(
                    height: 30.0,
                    color: Colors.red,
                  ),
                ),
                Expanded(
                  flex: 2,
                  child: Container(
                    height: 30.0,
                    color: Colors.green,
                  ),
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }

}